package functionInterface;

import org.junit.Test;

import java.util.function.Predicate;

/**
 * @Author com.alibaba.lizhen
 * @Date 2021/3/23 5:53 下午
 * @Version 1.0
 * @Description
 */
public class PredicateTest {

    @Test
    public void test(){
        boolean result = changeBoolean("hello", (str) -> str.length() > 5);
        System.out.println(result);
    }

    /**
     *  Predicate<T> 断言型接口
     * @param str
     * @param pre
     * @return
     */
    public boolean changeBoolean(String str, Predicate<String> pre){
        return pre.test(str);
    }
}
